<?php
ini_set('display_errors','on');
require_once 'TVB/Config/requires.php';
require_once 'TVB/ObjectRecord/all.php';
//require_once 'TVB/Message/MessageHelper.php';
require_once 'TVB/PWORKS/mvc/action/BaseAction.class.php'; 
require_once 'TVB/PWORKS/message/Messager.class.php';

require_once 'TVB/mytvplus/MstatReportTool/common/timeFormat.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/statClass.php';
require_once 'TVB/mytvplus/MstatReportTool/common/getStatsClass.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/AppConfiguration.class.php' ;
require_once 'TVB/mytvplus/MstatReportTool/common/ExportData.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/model/model.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/util/CommonFilter.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/util/CommonUtils.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/util/CommonOtherUtils.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/Authen.class.php';
#require_once 'TVB/mytvplus/MstatReportTool/common/util/memcaheInit.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/ErrorMessage.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/error.inc';
require_once 'TVB/mytvplus/MstatReportTool/common/requires.php';
require_once 'TVB/PMSWebService/Client/requires.php';

//-- autoload functionl{{{
function __autoload($class) {
    
    $file_path = AC::DEFAULT_BASE_LIB_PATH."/model/{$class}.class.php";
	try {
    	if(file_exists($file_path)) {
		    require AC::DEFAULT_SHORT_LIB_PATH."/model/{$class}.class.php";
	    }
        else {
		    throw new Exception("No such file: $file_path");
	    }
	}
    catch(Exception $e) {
		error_log(print_r($e,1));
    }
}


//-- init action{{{
Model::$dbo['w'] = CommonUtils::getDbConn(1);
Model::$dbo['r'] = CommonUtils::getDbConn();
//}}}
?>
